Skip to content

Add more wf api samples#277

Open
kcantrel wants to merge 11 commits intomainfrom
add_more_wf_API_samples
Open

Add more wf api samples#277
kcantrel wants to merge 11 commits intomainfrom
add_more_wf_API_samples

Conversation

@kcantrel
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the repository’s Workload Factory API sample scripts and slightly extends the FSx for ONTAP AWS CLI filesystem creation helper to support additional request options.

Changes:

  • Add new Workload Factory “builders” API samples for EDA project configuration, CI/CD projects, and CI/CD clones.
  • Update multiple existing Workload Factory scripts’ required-parameter messaging for CREDENTIALS_ID.
  • Extend create_fsxn_filesystem to accept an alternate AWS endpoint URL and attempt to support updating route tables during FSx for ONTAP filesystem creation.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 35 comments.

Show a summary per file
File Description
Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem Adds -route-tables and -endpoint_url support to FSxN filesystem creation/wait flow.
Management-Utilities/Workload-Factory-API-Samples/volume_delete Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/volume_clone Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/snapshot_create Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/list_volumes Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/list_svms Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/list_snapmirrors Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/list_filesystems Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/link_disassociate Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/link_associate Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/fsxn_credentials_set Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery Updates CREDENTIALS_ID required-option error messaging.
Management-Utilities/Workload-Factory-API-Samples/list_eda_project_config New script to list EDA project config (“configure”) builder data.
Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects New script to list EDA CI/CD projects (builders API).
Management-Utilities/Workload-Factory-API-Samples/list_cicd_clones New script to list clones for a given CI/CD project (builders API).
Management-Utilities/Workload-Factory-API-Samples/eda_project_config_delete New script to delete EDA project config (builders API).
Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create New script to create EDA project config (builders API).
Management-Utilities/Workload-Factory-API-Samples/cicd_project_delete New script to delete a CI/CD project (builders API).
Management-Utilities/Workload-Factory-API-Samples/cicd_project_create New script to create a CI/CD project (builders API).
Management-Utilities/Workload-Factory-API-Samples/cicd_clones_delete New script to delete a CI/CD clone (builders API).
Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create New script to create a CI/CD clone (builders API).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can get the list of accounts you have access to by running the "list_bluexp_accts" script
found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n'
required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required.
required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script.
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the error message: “Workload Facotry” should be “Workload Factory”.

Suggested change
required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script.
required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script.

Copilot uses AI. Check for mistakes.
You can get the list of accounts you have access to by running the "list_bluexp_accts" script
found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n'
required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required.
required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to list resources is required to run this script.
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the error message: “Workload Facotry” should be “Workload Factory”.

Suggested change
required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to list resources is required to run this script.
required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to list resources is required to run this script.

Copilot uses AI. Check for mistakes.
You can get the list of accounts you have access to by running the "list_bluexp_accts" script
found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n'
required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required.
required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script.
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the error message: “Workload Facotry” should be “Workload Factory”.

Suggested change
required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script.
required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +5
# This script is used to list all the EDA CI/CD projects user has access to.
#
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header comment says this script lists “EDA CI/CD projects”, but the implementation calls /projects/${PROJECT_ID}/operations/clones and formats clone fields. Update the description to reflect that this script lists clones for a specific project.

Copilot uses AI. Check for mistakes.
Comment on lines +103 to +107
echo "exit code=$?"
echo "output"
cat $tmpout
echo "error"
cat $tmperr
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The post-request logging here is misleading/noisy: run_curl exits on non-2xx responses, so echo "exit code=$?" will always be 0 on success, and tmperr will typically be empty. Consider replacing this with a simple success message and (optionally) a -j flag to print the raw JSON response when desired.

Copilot uses AI. Check for mistakes.
You can get a list of credentials by running the "list_credentials" script
found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n'
required_options["projectId"]='Error: The ID of the project to delete is required.
You can get a list of projects by running the "list_cicd_project" script
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The required-parameter help text references a non-existent script name: it says to run "list_cicd_project", but the repository contains "list_cicd_projects". Update the message to point users to the correct script.

Suggested change
You can get a list of projects by running the "list_cicd_project" script
You can get a list of projects by running the "list_cicd_projects" script

Copilot uses AI. Check for mistakes.
-security-group-id|--security-group-id) securityGroupOption="--security-group-ids $2"
shift
;;
-route-tables|--route-tables) routeTables='"RouteTableIds":"'$2'",'
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -route-tables option builds RouteTableIds as a single comma-separated string (e.g., "rtb-1,rtb-2") and injects it into the ONTAP configuration JSON. The FSx API expects RouteTableIds to be a JSON array of strings, so this will produce a request payload that the API is unlikely to accept. Convert the comma-separated input into a JSON array (or build the entire --ontap-configuration with jq to avoid manual JSON string assembly).

Suggested change
-route-tables|--route-tables) routeTables='"RouteTableIds":"'$2'",'
-route-tables|--route-tables)
IFS=',' read -r -a routeTableIds <<< "$2"
routeTables='"RouteTableIds":['
firstRouteTable=true
for routeTableId in "${routeTableIds[@]}"; do
routeTableId="${routeTableId#"${routeTableId%%[![:space:]]*}"}"
routeTableId="${routeTableId%"${routeTableId##*[![:space:]]}"}"
[ -z "$routeTableId" ] && continue
if [ "$firstRouteTable" = true ]; then
firstRouteTable=false
else
routeTables="$routeTables,"
fi
routeTables="$routeTables\"$routeTableId\""
done
routeTables="$routeTables],"

Copilot uses AI. Check for mistakes.
required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script.
You can get the list of accounts you have access to by running the "list_bluexp_accts" script
found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n'
required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script.
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the error message: “Workload Facotry” should be “Workload Factory”.

Suggested change
required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script.
required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script.

Copilot uses AI. Check for mistakes.
Comment on lines +80 to +82
required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script.
You can get a list of credentials by running the "list_credentials" script
found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n'
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CREDENTIALS_ID is required/accepted but never used in the DELETE request (URL is /builders/v1/configure with no credentials component and no headers/body use it). Either remove -c/CREDENTIALS_ID from this script’s interface, or use it explicitly in the request if the API requires it.

Copilot uses AI. Check for mistakes.
credentials you have access to.
-g tag1[,tag2,...] - is a comma separated list of tags to use in the filter.
-y single|multiselect,single|multiselect,... - is a comma separated list of filter types
corresponding to the tags specified with the -a option.
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the usage text for -y, it says the filter types correspond to tags specified with the -a option, but tags are provided via -g. This is likely to confuse users; update the usage description to reference -g instead of -a.

Suggested change
corresponding to the tags specified with the -a option.
corresponding to the tags specified with the -g option.

Copilot uses AI. Check for mistakes.
…ct so the user didn't have to prvoide it; Created a new list_snapshots script so a user can easily get the snapshots; Updated list_cicd_project to list the volume_ID associated with the volume so it can be used with 'list_snapshots'.
…ct so the user didn't have to prvoide it; Created a new list_snapshots script so a user can easily get the snapshots; Updated list_cicd_project to list the volume_ID associated with the volume so it can be used with 'list_snapshots'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants